-
Notifications
You must be signed in to change notification settings - Fork 7
Rosenbrock DAE Constraint Count #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ging current behavior: added constraint count/name setters and used them to size Jacobian/state vectors and extend variable names, while carrying the count into StateParameters (include/micm/solver/solver_builder.hpp, include/micm/solver/solver_builder.inl). State now honors the provided constraint count when building identity masks and Jacobian dimensions (include/micm/solver/state.inl). AlphaMinusJacobian applies αI using a row-aware identity mask, preparing for masked constraint rows (include/micm/solver/rosenbrock.inl). Tests: cmake --build build and ctest --output-on-failure (all 48 tests passed).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
==========================================
+ Coverage 94.66% 94.79% +0.12%
==========================================
Files 66 69 +3
Lines 3245 3440 +195
==========================================
+ Hits 3072 3261 +189
- Misses 173 179 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implement algebraic constraint support for the Rosenbrock solver: - Add Constraint base class and EquilibriumConstraint for chemical equilibria - Add ConstraintSet manager following ProcessSet pattern - Add SolverBuilder.SetConstraints() API to inject constraints - Modify State to include constraint variables with identity diagonal - Integrate constraint forcing and Jacobian into Rosenbrock solver loop - Fix temporary variable sizing to include constraint dimensions Infrastructure is complete with 55 passing tests. Full DAE time integration requires additional solver modifications (documented in TODO.md). Co-Authored-By: Claude Opus 4.5 <[email protected]>
Modified AlphaMinusJacobian() to add alpha to ALL diagonal elements, not just ODE rows. This treats algebraic constraints as stiff ODEs (ε*z' = g(y,z) with ε=hγ), ensuring K values scale with step size H and preventing numerical instability from c/H terms in Rosenbrock stage computation. Changes: - rosenbrock.inl: Add alpha to all diagonals in both vectorized and non-vectorized AlphaMinusJacobian() implementations - test_equilibrium.cpp: Add DAESolveWithConstraint integration test demonstrating working DAE solve with projection step - Update ARCHITECTURE.md and TODO.md with fix documentation Co-Authored-By: Claude Opus 4.5 <[email protected]>
Custom skills for building, testing, and debugging MICM: - /micm-test: Build and run tests (all, filtered, or build-only) - /debug-test: Debug failing tests with tracing support - /solver-debug: Investigate numerical solver issues These skills codify the debugging strategies used during DAE constraint development, including matrix conditioning checks, K value tracing, and sign convention verification. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Documents DAE constraint system architecture, debugging strategies, and available skills for AI-assisted development sessions. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Created comprehensive test case library for DAE constraint validation: - Atmospheric equilibria (carbonate, ammonia, SO2) - Multi-constraint systems (iron-oxalate, O3-NOx PSS) - Stiff/numerical challenges (extreme K, temperature-dependent) - Practical applications (ISORROPIA-style, Chapman mechanism) - Edge cases (constraint switching, near-singular) Updated TODO.md: Chapman mechanism with QSSA constraint is next. This will require QSSAConstraint or CustomConstraint implementation. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Tests should write CSV to stdout for plotting: - Header line with column names - One line per timestep with all state variables - Include analytical values where available - Redirect to file: ./test_chapman > results.csv Enables visual validation with Python/gnuplot. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Provides a copy-paste prompt to continue DAE work: - Points to TODO.md and TESTS.md - Identifies Chapman mechanism as next task - Suggests build/test verification first Co-Authored-By: Claude Opus 4.5 <[email protected]>
Documents the approach for merging the DAE constraint system into main via three incremental, reviewable PRs. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Collaborator
|
Breaking PR into 3 smaller PRs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.